//
//  File.swift
//  MT
//
//  Created by ooops on 2020/5/18.
//  Copyright © 2020 张强. All rights reserved.
//

import Foundation
import ObjectMapper
import MTCategory

class MTRankingModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var result: [MTRankingInfoModel]?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
    }
}

class MTRankingInfoModel: Mappable {
    
    /// 用户年龄
    var age: Int?
    /// 用户区域
    var area: String?
    /// 用户生日
    var birthday: Date?
    /// 城市
    var city: String?
    /// 星座
    var constellation: String?
    /// 学位
    var degree: String?
    /// 头像地址
    var headerUrl: String?
    /// 身高，单位cm
    var height: CGFloat?
    var id: Int?
    /// 行业
    var industry: String?
    var nickname: String?
    /// 位置
    var position: String?
    var province: String?
    /// 学校
    var school: String?
    /// 性别 0男 1女
    var sex: Int = 0
    var signature: String?
    /// vip类型：0普通用户，1黄V,2蓝V
    var vipType: Int = 0
    /// 体重 KG
    var weight: CGFloat?
    /// 排行类型 1 - 魅力 2 - 实力
    var rankingType: Int?
    /// 用户名
    var userName: String?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        age    <- map["age"]
        area <- map["area"]
        birthday <- map["birthday"]
        city <- map["city"]
        constellation <- map["constellation"]
        degree <- map["degree"]
        headerUrl <- map["headerUrl"]
        height <- map["height"]
        id <- map["id"]
        industry <- map["industry"]
        nickname <- map["nickname"]
        position <- map["position"]
        province <- map["province"]
        school <- map["school"]
        sex <- map["sex"]
        signature <- map["signature"]
        vipType <- map["vipType"]
        weight <- map["weight"]
        rankingType <- map["rankingType"]
        userName <- map["userName"]
    }
}
